package teste;

import java.sql.SQLException;
import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;

import com.wesley.future.Model.Usuario;
import com.wesley.future.Utils.HibernateUtil;

public class PesquisarUsuario {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		 	 Session session = HibernateUtil.getSessionFactory().openSession();
				List<Object[]> query = session.createSQLQuery("select * from usuarios").list();
				for (Object[]  qry:query)
				{
				
					System.out.println("Id:"+ qry[0]);
					System.out.println("Nome:"+ qry[1]);
					System.out.println("Login:" + qry[2]);
					System.out.println("Senha:" + qry[3]);
	
	}
		session.close();
		 }
		 
}
